import React from 'react';
import { connect } from 'react-redux';
import { View, Button } from '@tarojs/components';
import Taro, { useRouter } from '@tarojs/taro';

import './index.scss';

const UnusualPage = () => {
  const router = useRouter();
  const { params = {} } = router;
  const tip = decodeURIComponent(params.tip) || '';
  const url = decodeURIComponent(params.url) || '';

  const refreash = () => {
    Taro.navigateTo({ url });
  };

  return (
    <View className="totalPage_unusual">
      <View className="imgArea">
        <View className="text">{tip}</View>
      </View>
      <Button className="btn customePageBackgroundStyle" onClick={refreash}>
        刷新
      </Button>
    </View>
  );
};

export default connect(() => ({}))(UnusualPage);
